home *** CD-ROM | disk | FTP | other *** search
/ Freelog 112 / FreelogNo112-NovembreDecembre2012.iso / Jeu / deadlyrace / deadlyrace_setup.exe / {app} / Data / Scripts / back4.lua < prev    next >
Encoding:
Text File  |  2010-03-09  |  993 b   |  61 lines

  1. local script = globalObject;
  2.  
  3. local interface;
  4. local commandMap = {};
  5.  
  6. local x = 0;
  7. local y = 0;
  8. local z = 0;
  9. local aim = nil;
  10.  
  11.  
  12. local function ExecuteCommands()
  13.     while(SetNextCommand(script))
  14.     do
  15.         local command = GetCurrentCommand(script);
  16.         if (commandMap[command])
  17.         then
  18.             commandMap[command]();
  19.         end
  20.     end
  21. end
  22.  
  23.  
  24.  
  25. local function AddObject()
  26.     local obj = GetCurrentParams(script);
  27.     interface = StringToPointer(obj);
  28. --    AddRef(interface);
  29. end
  30.  
  31. local function DeleteObject()
  32.     Release(interface);
  33.     StopScript(script);
  34.     interface = nil;
  35. end
  36.  
  37. local function ReleaseAll()
  38.     Release(interface);
  39.     interface = nil;
  40. end
  41.  
  42. local function UpdateGameInterface1()
  43.     UpdateGameInterface(interface);
  44. end
  45.  
  46.  
  47.  
  48. commandMap["release_all"] = ReleaseAll;
  49. commandMap["add_object"] = AddObject;
  50. commandMap["delete_object"] = DeleteObject;commandMap["video_end"] = VideoEnd;
  51.  
  52.  
  53.  
  54. while(true)
  55. do
  56.     ExecuteCommands();
  57.     UpdateInterface(interface);
  58.  
  59.     Update();
  60. end
  61.